<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .active {
      background-color: pink;
    }

    div {
      display: none;
      border: 1px solid #ccc;
      width: 300px;
      height: 200px;
    }

    .show {
      display: block;
    }
  </style>
</head>
<body>
  <button class="active" data-test="qwer">星锐</button>
  <button>速腾</button>
  <button>A3好</button>

  <div class="show">
    国产吉利车星锐好
  </div>
  <div>
    速腾也很好
  </div>
  <div>
    奥迪也很好
  </div>

  <script>
    var btns = document.querySelectorAll('button')
    var divs = document.querySelectorAll('div')

    for(var i = 0; i < btns.length; i++) {
      btns[i].setAttribute('data-index', i)

      btns[i].onclick = function() {
        // 按钮高了开始
        for(var i = 0; i < btns.length; i++) {
          btns[i].className = ''
        }
        this.className = 'active'
        // 高粱结束
        // div的展示
        for(var i = 0; i < divs.length; i++) {
          divs[i].className = ''
        }
        var index = this.getAttribute('data-index')
        divs[index].className = 'show'
      }
    }


  </script>
</body>
</html>